package com.woniuxy.rabbit.kill.rabbit;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * description: KillDeadConsumer <br>
 * date: 2022/1/15 4:50 下午 <br>
 * author: shesaifei <br>
 * version: 1.0 <br>
 */
@Component
public class KillDeadConsumer {

    @RabbitListener(queues = "kill_dead_queue")
    public void received(String userName, Channel channel, Message message) throws IOException {

        //手动确认收到 是否批量确认
        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
        //System.out.println("kill failed"+userName);


        //向用户返回结果
    }
}
